package com.punai.config.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.punai.config.domain.ConfigMaterialCategory;
import com.punai.config.domain.ConfigMaterialInfo;
import com.punai.config.domain.vo.ConfigMaterialInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ConfigMaterialInfoMapper extends BaseMapper<ConfigMaterialInfo> {

    /**
     * 根据 父级项查询最大排序
     * @param categoryId
     * @return
     */
    Integer selectMaxOrderNum(@Param("categoryId") String categoryId);

    /**
     * 根据类型 父级项与类型查询
     * @param type
     * @param categoryId
     * @return
     */
    List<ConfigMaterialInfoVo> selectAllByTypeAndCategoryId(@Param("type")String type, @Param("categoryId") String categoryId);

    /**
     * 根据类型 父级项与类型查询
     * @param type
     * @param categoryIds
     * @return
     */
    List<ConfigMaterialInfoVo> selectAllByTypeAndCategoryIds(@Param("type")String type, @Param("categoryIds") List<String> categoryIds);

    List<ConfigMaterialInfoVo> selectAllByTypeAndCategoryIdsAndCodeAndName(@Param("type") String type,
                                                                           @Param("categoryIds") List<String> categoryIds,
                                                                           @Param("code") String code,
                                                                           @Param("name") String name);
}
